package com.hdax.controller;


import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.hdax.entity.Dictionaries;
import com.hdax.service.DictionariesService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 * 字典表 前端控制器
 * </p>
 *
 * @author ${author}
 * @since 2021-03-22
 */
@RestController
@RequestMapping("/dictionaries")
public class DictionariesController {

    @Autowired
    private DictionariesService dictionariesService;

    @PostMapping("/findIntentionState")
    public List<Dictionaries> findIntentionState() {
        QueryWrapper<Dictionaries> queryWrapper = new QueryWrapper<>();
        queryWrapper.eq("type_name", "线索状态");
        List<Dictionaries> list = dictionariesService.list(queryWrapper);
        return list;
    }

    @PostMapping("/findDriveInterest")
    public List<Dictionaries> findDriveInterest() {
        QueryWrapper<Dictionaries> queryWrapper = new QueryWrapper<>();
        queryWrapper.eq("type_name", "试驾兴趣");
        List<Dictionaries> list = dictionariesService.list(queryWrapper);
        return list;
    }

    @PostMapping("/findIntentionLevel")
    public List<Dictionaries> findIntentionLevel() {
        QueryWrapper<Dictionaries> queryWrapper = new QueryWrapper<>();
        queryWrapper.eq("type_name", "意向等级");
        List<Dictionaries> list = dictionariesService.list(queryWrapper);
        return list;
    }

    @PostMapping("/findDevelopMode")
    public List<Dictionaries> findDevelopMode() {
        QueryWrapper<Dictionaries> queryWrapper = new QueryWrapper<>();
        queryWrapper.eq("type_name", "跟进方式");
        List<Dictionaries> list = dictionariesService.list(queryWrapper);
        return list;
    }

    @PostMapping("/findDevelopResult")
    public List<Dictionaries> findDevelopResult() {
        QueryWrapper<Dictionaries> queryWrapper = new QueryWrapper<>();
        queryWrapper.eq("type_name", "跟进结果");
        List<Dictionaries> list = dictionariesService.list(queryWrapper);
        return list;
    }

    @PostMapping("/findDriveType")
    public List<Dictionaries> findDriveType() {
        QueryWrapper<Dictionaries> queryWrapper = new QueryWrapper<>();
        queryWrapper.eq("type_name", "试驾类型");
        List<Dictionaries> list = dictionariesService.list(queryWrapper);
        return list;
    }

    @PostMapping("/findOpportunityState")
    public List<Dictionaries> findOpportunityState() {
        QueryWrapper<Dictionaries> queryWrapper = new QueryWrapper<>();
        queryWrapper.eq("type_name", "商机状态");
        List<Dictionaries> list = dictionariesService.list(queryWrapper);
        return list;
    }

    @PostMapping("/findOrderState")
    public List<Dictionaries> findOrderState() {
        QueryWrapper<Dictionaries> queryWrapper = new QueryWrapper<>();
        queryWrapper.eq("type_name", "订单状态");
        List<Dictionaries> list = dictionariesService.list(queryWrapper);
        return list;
    }
    @PostMapping("/findHandleState")
    public List<Dictionaries> findHandleState() {
        QueryWrapper<Dictionaries> queryWrapper = new QueryWrapper<>();
        queryWrapper.eq("type_name", "处理状态");
        List<Dictionaries> list = dictionariesService.list(queryWrapper);
        return list;
    }

}

